********************************************************************************
********************************************************************************
**
** Matthias Ecker-Ehrhardt, Soetkin Verhaegen, Sigrid Quack
** "Nonstate Actor Inclusion and the Social Legitimacy Global Governance Inst's"
** in International Studies Quarterly, 2025
**  
** Input: 
** 		WVS_Cross-national_Wave_7_Stata_v2_0.dta
**		WVS_trends_3_0_reduced.dta
**		Replication.dta
**
** Machine: Macbook Pro 16, Sequoia 15.3.1
** Program Version: Stata 17.0
**
********************************************************************************
********************************************************************************

* ssc install coefplot
* ssc install estout
* ssc install asdoc
* ssc install combomarginsplot
* ssc install addplot
* ssc install conjoint
* ssc install blindschemes

********************************************************************************

mkdir Figures
mkdir Tables

********************************************************************************
** Sample composition Appendix B ***********************************************
********************************************************************************

clear
use replication1

asdoc tab dCountry, save(Tables/TableB1a.rtf) replace 
asdoc tab agec dCountry, col nof save(Tables/TableB2a.rtf) replace 
asdoc tab educ dCountry, col nof save(Tables/TableB3a.rtf) replace 
asdoc tab male dCountry, col nof save(Tables/TableB4a.rtf) replace 

asdoc tab dCountry [iw=W], save(Tables/TableB1c.rtf) replace 
asdoc tab agec dCountry [iw=W], col nof save(Tables/TableB2c.rtf) replace 
asdoc tab educ dCountry [iw=W], col nof save(Tables/TableB3c.rtf) replace 
asdoc tab male dCountry [iw=W], col nof save(Tables/TableB4c.rtf) replace 


********************************************************************************
********************************************************************************
** Hypo1 ***********************************************************************
** H1: People support the inclusion of nonstate actors to enhance GGI leg ******
********************************************************************************
********************************************************************************

********************************************************************************
* MAIN ANALYSIS Figure 2 / Appendix Table C1/b
********************************************************************************


clear
use replication2  // UoA is scenario-profile (N = 12)
estimates drop _all
graph drop _all
set scheme plotplain

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum Scenario) clear : ci means Con_ch
sort Scenario Con_a_sum
format %9.2f mean se
save means_choice, replace
export delimited Scenario Con_a_sum mean se N ///
	using Tables/AppendixTableC1a, delimiter(tab) datafmt replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), /// 
	by(Scenario, note("") legend(off)) ///
	ytitle("Probability of choice") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) ///
	name(choice)

***

clear
use replication2  // UoA is scenario-profile (N = 12)

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum Scenario) clear : ci means Con_rate 
sort Scenario Con_a_sum
format %9.2f mean se
save means_rate, replace
export delimited Scenario Con_a_sum mean se N ///
	using Tables/AppendixTableC1b, delimiter(tab) datafmt replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), ///
	by(Scenario, note("") legend(off)) ///
	ytitle("Confidence in GGI") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) /// 
	name(rate)

gr combine ///
	choice ///
	rate ///
	, col(4) iscale(.8) // imargin(0 0 0 0)
	
graph export Figures/Figure2.pdf, replace



********************************************************************************
* ROBUSTENESS CHECK: weights / Appendix Figure D1
********************************************************************************

use replication2  // UoA is scenario-profile (N = 12)
estimates drop _all
graph drop _all
set scheme plotplain

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum Scenario) clear : ci means Con_ch [aw=W]

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), /// 
	by(Scenario, note("") legend(off)) ///
	ytitle("Probability of choice") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) ///
	name(choice)

clear
use replication2  // UoA is scenario-profile (N = 12)

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum Scenario) clear : ci means Con_rate [aw=W]

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), ///
	by(Scenario, note("") legend(off)) ///
	ytitle("Confidence in GGI") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) /// 
	name(rate)

gr combine ///
	choice ///
	rate ///
	, col(4) iscale(.8) // imargin(0 0 0 0)
graph export Figures/FigureD1.pdf, replace


********************************************************************************
* ROBUSTENESS CHECK: order of experimental treatment / Appendix Figures D2/D3
********************************************************************************

** block order ***********

clear
use replication2  // UoA is scenario-profile (N = 12)
estimates drop _all
graph drop _all
set scheme plotplain

gen blockorder=0 // order of blocks (3 blocks overall)
replace blockorder=BlockOrderr2 if nScenario==1
replace blockorder=BlockOrderr3 if nScenario==2
tab blockorder


gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum blockorder) clear : ci means Con_ch 
sort  Con_a_sum
format %9.2f mean se
save means_choice, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), /// 
	by( blockorder , note("") legend(off) col(3)) ///
	ytitle("Probability of choice") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) ///
	name(choice)

*	
	
clear
use replication2  // UoA is scenario-profile (N = 12)

gen blockorder=0 // order of blocks (3 blocks overall)
replace blockorder=BlockOrderr2 if nScenario==1
replace blockorder=BlockOrderr3 if nScenario==2
tab blockorder

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum  blockorder) clear : ci means Con_rate
sort  Con_a_sum
format %9.2f mean se
save means_rate, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), ///
	by( blockorder, note("") legend(off) col(3)) ///
	ytitle("Confidence in GGI") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) /// 
	name(rate)

gr combine ///
	choice ///
	rate ///
	, col(2) iscale(.7) imargin(0 0 0 0) ysize(2.4) xsize(5)
graph export Figures/FigureD2.pdf, replace


** profile number ***********

clear

use replication2  // UoA is scenario-profile (N = 12)
estimates drop _all
graph drop _all
set scheme plotplain

destring Profile, generate(profile) // order of profiles
tab profile

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum  profile) clear : ci means Con_ch 
sort  Con_a_sum
format %9.2f mean se
save means_choice, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), /// 
	by( profile , note("") legend(off) col(6)) ///
	ytitle("Probability of choice") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) ///
	name(choice)

**
	
clear

use replication2  // UoA is scenario-profile (N = 12)
destring Profile, generate(profile) // order of profiles
tab profile
gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum  profile) clear : ci means Con_rate 
sort  Con_a_sum
format %9.2f mean se
save means_rate, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), ///
	by( profile, note("") legend(off) col(6)) ///
	ytitle("Confidence in GGI") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) /// 
	name(rate)

gr combine ///
	choice ///
	rate ///
	, col(1) iscale(.7) imargin(0 0 0 0) ysize(4) xsize(5)
graph export Figures/FigureD3.pdf, replace




********************************************************************************
* ROBUSTENESS CHECK: F1, F2, F3 / Appendix Figure D4
********************************************************************************

** F1 ***********

clear
use replication2  // UoA is scenario-profile (N = 12)
estimates drop _all
graph drop _all
set scheme plotplain

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum Vig_F1) clear : ci means Con_ch 
sort  Con_a_sum
format %9.2f mean se
save means_choice, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), /// 
	by( Vig_F1 , note("") legend(off)) ///
	ytitle("Probability of choice") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) ///
	name(choice)

clear
use replication2  // UoA is scenario-profile (N = 12)

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum  Vig_F1) clear : ci means Con_rate
sort  Con_a_sum
format %9.2f mean se
save means_rate, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), ///
	by( Vig_F1, note("") legend(off)) ///
	ytitle("Confidence in GGI") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) /// 
	name(rate)

gr combine ///
	choice ///
	rate ///
	, col(2) iscale(1) imargin(0 0 0 0) ysize(2.4) xsize(5)
graph export Figures/FigureD4a.pdf, replace


** F2 ***********

clear

use replication2  // UoA is scenario-profile (N = 12)
estimates drop _all
graph drop _all
set scheme plotplain

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum  Vig_F2) clear : ci means Con_ch 
sort  Con_a_sum
format %9.2f mean se
save means_choice, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), /// 
	by( Vig_F2 , note("") legend(off) col(3)) ///
	ytitle("Probability of choice") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) ///
	name(choice)

clear

use replication2  // UoA is scenario-profile (N = 12)

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum  Vig_F2) clear : ci means Con_rate 
sort  Con_a_sum
format %9.2f mean se
save means_rate, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), ///
	by( Vig_F2, note("") legend(off) col(3)) ///
	ytitle("Confidence in GGI") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) /// 
	name(rate)

gr combine ///
	choice ///
	rate ///
	, col(2) iscale(1) imargin(0 0 0 0) ysize(2.4) xsize(5)
graph export Figures/FigureD4b.pdf, replace

** F3 ***********

clear

use replication2  // UoA is scenario-profile (N = 12)
estimates drop _all
graph drop _all
set scheme plotplain

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum  Vig_F3) clear : ci means Con_ch 
sort  Con_a_sum
format %9.2f mean se
save means_choice, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), /// 
	by( Vig_F3 , note("") legend(off) col(3)) ///
	ytitle("Probability of choice") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) ///
	name(choice)

clear

use replication2  // UoA is scenario-profile (N = 12)

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum  Vig_F3) clear : ci means Con_rate 
sort  Con_a_sum
format %9.2f mean se
save means_rate, replace

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), ///
	by( Vig_F3, note("") legend(off) col(3)) ///
	ytitle("Confidence in GGI") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) /// 
	name(rate)

gr combine ///
	choice ///
	rate ///
	, col(2) iscale(1) imargin(0 0 0 0) ysize(2.4) xsize(5)
graph export Figures/FigureD4c.pdf, replace


********************************************************************************
* ROBUSTENESS CHECK: by country / Appendix Figure D5
********************************************************************************

clear
estimates drop _all
graph drop _all
set scheme plotplain
graph drop _all

foreach c in BR DE US ZA {

clear
use replication2  // UoA is scenario-profile (N = 12)

keep if `c'==1

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum Scenario) clear : ci means Con_ch 

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), /// 
	by(Scenario, note("") legend(off)) title(`c') ///
	ytitle("Probability of choice") yla(, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) ///
	name(`c' , replace)


} 

gr combine ///
	BR ///
	DE ///
	US ///
	ZA ///
	, col(2) iscale(.8) title("Choice")
graph export Figures/FigureD5a.pdf, replace



estimates drop _all
graph drop _all

foreach c in BR DE US ZA {

clear

use replication2  // UoA is scenario-profile (N = 12)

set scheme plotplain

keep if `c'==1

gen Con_a_sum=Con_a1+Con_a2+Con_a3+Con_a4 // #of included actors per proposal

statsby, by(Con_a_sum Scenario) clear : ci means Con_rate 

graph twoway (scatter mean Con_a_sum) (rcap lb ub Con_a_sum), /// 
	by(Scenario, note("") legend(off)) title(`c') ///
	ytitle("Confidence in GGI") ylabel(3(1)6, labsize(*1.2) format(%9.1f)) /// 
	xtitle("No. of included nonstate actors") xla(, labsize(*1.2)) ///
	name(`c', replace)


} 

gr combine ///
	BR ///
	DE ///
	US ///
	ZA ///
	, col(2) iscale(.8) title("Confidence")
graph export Figures/FigureD5b.pdf, replace


********************************************************************************
* MAIN ANALYSIS Figure 3 / Appendix Table C2
********************************************************************************

clear
use replication2  // UoA is scenario-profile (N = 12)
estimates drop _all
graph drop _all
set scheme plotplain

reg Con_ch Con_a? if Scenario=="Energy" , cl(id)
estimates store Ec
reg Con_ch Con_a? if Scenario=="Internet", cl(id)
estimates store Ic

coefplot (Ec, label(Energy))(Ic, label(Internet)) ///
	, drop(_cons) title("AMCE on choice") ///
	xlabel(0(.1).3) legend(c(1) pos(2) ring(0)) name(c) 
	
 
reg Con_rate Con_a? if Scenario=="Energy", cl(id)
estimates store Er
reg Con_rate Con_a? if Scenario=="Internet", cl(id)
estimates store Ir

coefplot (Er, label(Energy))(Ir, label(Internet)) ///
	, drop(_cons) title("AMCE on confidence") ///
	xlabel(0(.1).8) legend(c(1) pos(2) ring(0)) name(r) 

esttab * using Tables/TableC2.rtf, se(%9.3f) b(%9.3f) ///
 scalars(N) ar2 label varwidth(16) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	nobaselevels replace	
	
gr combine ///
	c ///
	r ///	
	, col(2) iscale(.8) 
graph export Figures/Figure3.pdf, replace


********************************************************************************
* ROBUSTENESS CHECK: with weights / Appendix Table D6
********************************************************************************


clear
use replication2  // UoA is scenario-profile (N = 12)
estimates drop _all
graph drop _all
set scheme plotplain

reg Con_ch Con_a? if Scenario=="Energy" [pw=W], cl(id)
estimates store Ec
reg Con_ch Con_a? if Scenario=="Internet" [pw=W], cl(id)
estimates store Ic

coefplot (Ec, label(Energy))(Ic, label(Internet)) ///
	, drop(_cons) title("AMCE on choice") ///
	xlabel(0(.1).3) legend(c(1) pos(2) ring(0)) name(c) 
	
 
reg Con_rate Con_a? if Scenario=="Energy" [pw=W], cl(id)
estimates store Er
reg Con_rate Con_a? if Scenario=="Internet" [pw=W], cl(id)
estimates store Ir

coefplot (Er, label(Energy))(Ir, label(Internet)) ///
	, drop(_cons) title("AMCE on confidence") ///
	xlabel(0(.1).8) legend(c(1) pos(2) ring(0)) name(r) 

gr combine ///
	c ///
	r ///	
	, col(2) iscale(.8) 
graph export Figures/FigureD6.pdf, replace



********************************************************************************
* ROBUSTENESS CHECK: by order of experimental treatment / Appendix Figure D7
********************************************************************************


// choice

clear
use replication2  // UoA is scenario-profile (N = 12)

estimates drop _all
graph drop _all
set scheme plotplain

gen blockorder=0 // order of blocks (3 blocks overall)
replace blockorder=BlockOrderr2 if nScenario==1
replace blockorder=BlockOrderr3 if nScenario==2
tab blockorder

reg Con_ch Con_a? dEnergy if blockorder==1 , cl(id)
estimates store blockorder_1
reg Con_ch Con_a? dEnergy if blockorder==2 , cl(id)
estimates store blockorder_2
reg Con_ch Con_a? dEnergy if blockorder==3 , cl(id)
estimates store blockorder_3

coefplot (blockorder_1, label(Block1))(blockorder_2, label(Block2))  ///
	(blockorder_3, label(Block3)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).3) legend(c(1) pos(2) ring(0)) name(blockorder) 

	
destring Profile, generate(profile) // order of profiles
tab profile
	
reg Con_ch Con_a? dEnergy if profile==1 , cl(id)
estimates store profile1
reg Con_ch Con_a? dEnergy if profile==2 , cl(id)
estimates store profile2
reg Con_ch Con_a? dEnergy if profile==3 , cl(id)
estimates store profile3
reg Con_ch Con_a? dEnergy if profile==4 , cl(id)
estimates store profile4
reg Con_ch Con_a? dEnergy if profile==5 , cl(id)
estimates store profile5
reg Con_ch Con_a? dEnergy if profile==6 , cl(id)
estimates store profile6

coefplot ///
	(profile1, label(profile1)) ///	
	(profile2, label(profile2)) ///
	(profile3, label(profile3)) ///
	(profile4, label(profile4)) ///
	(profile5, label(profile5)) ///
	(profile6, label(profile6)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).6) legend(c(1) pos(2) ring(0)) name(profile) 
	
gr combine ///
	blockorder ///
	profile ///
	, col(1) iscale(.8) title("AMCE on choice")
graph export Figures/FigureD7a.pdf, replace



// rate


clear
use replication2  // UoA is scenario-profile (N = 12)

estimates drop _all
graph drop _all
set scheme plotplain

gen blockorder=0 // order of blocks (3 blocks overall)
replace blockorder=BlockOrderr2 if nScenario==1
replace blockorder=BlockOrderr3 if nScenario==2
tab blockorder

reg Con_rate Con_a? dEnergy if blockorder==1 , cl(id)
estimates store blockorder_1
reg Con_rate Con_a? dEnergy if blockorder==2 , cl(id)
estimates store blockorder_2
reg Con_rate Con_a? dEnergy if blockorder==3 , cl(id)
estimates store blockorder_3

coefplot (blockorder_1, label(Block1))(blockorder_2, label(Block2)) ///
	(blockorder_3, label(Block3)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).8) legend(c(1) pos(2) ring(0)) name(blockorder)

	
destring Profile, generate(profile) // order of profiles
tab profile
	
reg Con_rate Con_a? dEnergy if profile==1 , cl(id)
estimates store profile1
reg Con_rate Con_a? dEnergy if profile==2 , cl(id)
estimates store profile2
reg Con_rate Con_a? dEnergy if profile==3 , cl(id)
estimates store profile3
reg Con_rate Con_a? dEnergy if profile==4 , cl(id)
estimates store profile4
reg Con_rate Con_a? dEnergy if profile==5 , cl(id)
estimates store profile5
reg Con_rate Con_a? dEnergy if profile==6 , cl(id)
estimates store profile6

coefplot ///
	(profile1, label(profile1)) ///	
	(profile2, label(profile2)) ///
	(profile3, label(profile3)) ///
	(profile4, label(profile4)) ///
	(profile5, label(profile5)) ///
	(profile6, label(profile6)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).8) legend(c(1) pos(2) ring(0)) name(profile) 
	
gr combine ///
	blockorder ///
	profile ///
	, col(1) iscale(.8) title("AMCE on confidence")
graph export Figures/FigureD7b.pdf, replace


********************************************************************************
* ROBUSTENESS CHECK: by F1, F2, F3 / Appendix Figure D8
********************************************************************************

// choice

clear
use replication2  // UoA is scenario-profile (N = 12)

estimates drop _all
graph drop _all
set scheme plotplain

reg Con_ch Con_a? dEnergy if Vig_F1_0==1 , cl(id)
estimates store F1_0
reg Con_ch Con_a? dEnergy if Vig_F1_1==1 , cl(id)
estimates store F1_1

coefplot (F1_0, label(without Gov))(F1_1, label(with Gov)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).3) legend(c(1) pos(2) ring(0)) name(F1) 

reg Con_ch Con_a? dEnergy if Vig_F2_0==1 , cl(id)
estimates store F2_0
reg Con_ch Con_a? dEnergy if Vig_F2_1==1 , cl(id)
estimates store F2_1
reg Con_ch Con_a? dEnergy if Vig_F2_2==1 , cl(id)
estimates store F2_2

coefplot (F2_0, label(control))(F2_1, label(technical complex)) ///
	(F2_2, label(all aspects)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).3) legend(c(1) pos(2) ring(0)) name(F2) 
	
	
reg Con_ch Con_a? dEnergy if Vig_F3_0==1 , cl(id)
estimates store F3_0
reg Con_ch Con_a? dEnergy if Vig_F3_1==1 , cl(id)
estimates store F3_1
reg Con_ch Con_a? dEnergy if Vig_F3_2==1 , cl(id)
estimates store F3_2

coefplot (F3_0, label(control))(F3_1, label(different costs/benefits)) ///
	(F3_2, label(similar costs/benefits)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).3) legend(c(1) pos(2) ring(0)) name(F3) 
	
gr combine ///
	F1 ///
	F2 ///
	F3 ///
	, col(1) iscale(.8) title("AMCE on choice")
graph export Figures/FigureD8a.pdf, replace


// rate

clear
use replication2  // UoA is scenario-profile (N = 12)

estimates drop _all
graph drop _all
set scheme plotplain

reg Con_rate Con_a? dEnergy if Vig_F1_0==1 , cl(id)
estimates store F1_0
reg Con_rate Con_a? dEnergy if Vig_F1_1==1 , cl(id)
estimates store F1_1

coefplot (F1_0, label(without Gov))(F1_1, label(with Gov)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).8) legend(c(1) pos(2) ring(0)) name(F1) 

reg Con_rate Con_a? dEnergy if Vig_F2_0==1 , cl(id)
estimates store F2_0
reg Con_rate Con_a? dEnergy if Vig_F2_1==1 , cl(id)
estimates store F2_1
reg Con_rate Con_a? dEnergy if Vig_F2_2==1 , cl(id)
estimates store F2_2

coefplot (F2_0, label(control))(F2_1, label(technical complex)) ///
	(F2_2, label(all aspects)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).8) legend(c(1) pos(2) ring(0)) name(F2) 
	
	
reg Con_rate Con_a? dEnergy if Vig_F3_0==1 , cl(id)
estimates store F3_0
reg Con_rate Con_a? dEnergy if Vig_F3_1==1 , cl(id)
estimates store F3_1
reg Con_rate Con_a? dEnergy if Vig_F3_2==1 , cl(id)
estimates store F3_2

coefplot (F3_0, label(control))(F3_1, label(different costs/benefits)) ///
	(F3_2, label(similar costs/benefits)) ///
	, drop(_cons dEnergy) ///
	xlabel(0(.1).8) legend(c(1) pos(2) ring(0)) name(F3) 
	
gr combine ///
	F1 ///
	F2 ///
	F3 ///
	, col(1) iscale(.8) title("AMCE on confidence")
graph export Figures/FigureD8b.pdf, replace
	
	 
********************************************************************************
* ROBUSTENESS CHECK: by country / Appendix Figure D9
********************************************************************************

estimates drop _all
graph drop _all
set scheme plotplain

foreach c in BR DE US ZA {

clear
use replication2  // UoA is scenario-profile (N = 12)
keep if `c'==1

reg Con_ch Con_a? if Scenario=="Energy", cl(id)
estimates store E_`c'
reg Con_ch Con_a? if Scenario=="Internet", cl(id)
estimates store I_`c'

coefplot (E_`c', label(Energy))(I_`c', label(Internet)) ///
	, drop(_cons) title(`c') ///
	xlabel(0(.1).3) xscale(range(-.05 .3)) legend(c(1) pos(2) ring(0)) name(`c') 
} 

gr combine ///
	BR ///
	DE ///
	US ///
	ZA ///
	, col(2) iscale(.8) title("AMCE on choice")
graph export Figures/FigureD9a.pdf, replace


estimates drop _all
graph drop _all
set scheme plotplain

foreach c in BR DE US ZA {
	
clear
use replication2  // UoA is scenario-profile (N = 12)
keep if `c'==1

reg Con_rate Con_a? if Scenario=="Energy" [pw=W], cl(id)
estimates store E_`c'
reg Con_rate Con_a? if Scenario=="Internet" [pw=W], cl(id)
estimates store I_`c'

coefplot (E_`c', label(Energy))(I_`c', label(Internet)) ///
	, drop(_cons) title(`c') ///
	xlabel(0(.1).9) xscale(range(-.05 .9)) legend(c(1) pos(2) ring(0)) name(`c') 
} 

gr combine ///
	BR ///
	DE ///
	US ///
	ZA ///
	, col(2) iscale(.8) title("AMCE on confidence")
graph export Figures/FigureD9b.pdf, replace   
	 
	 
	
	
	
********************************************************************************
********************************************************************************
** Hypo2 ***********************************************************************
** H2 a-e: The more an individual expects a nonstate actor to…
** (a) … enhance the availability of expertise within a governance process,
** (b) … enhance the commitment to the public interest in a governance process,
** (c) … improve the representation of marginalized groups within...,
** (d) … enhance the operational capacity of a governance process,
** (e) … enhance the transparency of a governance process,
** the more the individual will support the inclusion of this nonstate actor...
********************************************************************************
********************************************************************************


********************************************************************************
** MAIN MODELS **** AMCE ***** Figure 4a/b / Appendix Table C3/C4 **************
********************************************************************************


** Choice

clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain
tab Actor, nol


reg Con_ch i.Con_a##i.R1_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_ch i.Con_a##i.R1_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_ch i.Con_a##i.R2_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_ch i.Con_a##i.R2_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_ch i.Con_a##i.R3_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_ch i.Con_a##i.R3_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_ch i.Con_a##i.R4_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_ch i.Con_a##i.R4_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_ch i.Con_a##i.R5_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_ch i.Con_a##i.R5_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	

	
esttab * using Tables/TableC3.rtf, se(%9.3f) b(%9.3f) ///
 ar2 label scalars(N) varwidth(16) starlevels( * 0.05 ** 0.01 *** 0.001)   ///
	nobaselevels replace

gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on choice") imargin(0 0 0 0) 
graph export Figures/Figure4a.pdf, replace



** rate


clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


reg Con_rate i.Con_a##i.R1_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_rate i.Con_a##i.R1_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_rate i.Con_a##i.R2_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_rate i.Con_a##i.R2_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_rate i.Con_a##i.R3_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_rate i.Con_a##i.R3_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_rate i.Con_a##i.R4_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_rate i.Con_a##i.R4_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_rate i.Con_a##i.R5_a if Scenario=="Energy" , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_rate i.Con_a##i.R5_a if Scenario=="Internet" , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	
	
	
esttab * using Tables/TableC4.rtf, se(%9.3f) b(%9.3f) ///
 ar2 label scalars(N) varwidth(16) starlevels( * 0.05 ** 0.01 *** 0.001)   ///
	nobaselevels replace

gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on confidence") imargin(0 0 0 0)
graph export Figures/Figure4b.pdf, replace



********************************************************************************
** MAIN MODELS **** MM ***** Figure 5 / Appendix Figure C1 *********************
********************************************************************************

 
clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


local VAR "R1_a R2_a R3_a R4_a R5_a"
local LAB  ///
"Expertise Public_Interest Representation Operational_Capacities Transparency"
local n : word count `VAR'

forvalues i = 1/`n' {
local a : word `i' of `VAR'
local b : word `i' of `LAB'

conjoint Con_ch Con_a if nScenario==1, est(mm) id(id) sub(`a') 
matrix rE1 = e(results__1)
matrix rE2 = e(results__2)
matrix rE3 = e(results__3)
matrix rE4 = e(results__4)
matrix rE5 = e(results__5)
matrix rE6 = e(results__6)
conjoint Con_ch Con_a if nScenario==2, est(mm) id(id) sub(`a') 
matrix rI1 = e(results__1)
matrix rI2 = e(results__2)
matrix rI3 = e(results__3)
matrix rI4 = e(results__4)
matrix rI5 = e(results__5)
matrix rI6 = e(results__6)

coefplot ///
	matrix(rE1[,1]) matrix(rI1[,1]) ||  ///
	matrix(rE2[,1]) matrix(rI2[,1]) ||  ///
	matrix(rE3[,1]) matrix(rI3[,1]) ||  ///
	matrix(rE4[,1]) matrix(rI4[,1]) ||  ///
	matrix(rE5[,1]) matrix(rI5[,1]) ||  ///
	matrix(rE6[,1]) matrix(rI6[,1]) ||  ///
	, 	byopts(cols(1) legend(off) iscale(1.1)) ci((5 6))   ///
	bylabels("1 (lowest)" "2" "3" "4" "5" "6 (highest)")   ///
	graphregion(col(white)) xlabel(.3(.1).7)  ///
	xtitle(MM(Choice) by `b') ///
	subtitle(, justification(left) bcolor(white)) name(choice`a') 
	
	//xscale(noline)
	
conjoint Con_rate Con_a if nScenario==1, est(mm) id(id) sub(`a') 
matrix rE1 = e(results__1)
matrix rE2 = e(results__2)
matrix rE3 = e(results__3)
matrix rE4 = e(results__4)
matrix rE5 = e(results__5)
matrix rE6 = e(results__6)
conjoint Con_rate Con_a if nScenario==2, est(mm) id(id) sub(`a') 
matrix rI1 = e(results__1)
matrix rI2 = e(results__2)
matrix rI3 = e(results__3)
matrix rI4 = e(results__4)
matrix rI5 = e(results__5)
matrix rI6 = e(results__6)


coefplot ///
	matrix(rE1[,1]) matrix(rI1[,1]) ||  ///
	matrix(rE2[,1]) matrix(rI2[,1]) ||  ///
	matrix(rE3[,1]) matrix(rI3[,1]) ||  ///
	matrix(rE4[,1]) matrix(rI4[,1]) ||  ///
	matrix(rE5[,1]) matrix(rI5[,1]) ||  ///
	matrix(rE6[,1]) matrix(rI6[,1]) ||  ///
	, 	byopts(cols(1) legend(off) iscale(1.1)) ci((5 6))  ///
	bylabels("1 (lowest)" "2" "3" "4" "5" "6 (highest)")   ///
	graphregion(col(white)) xlabel(3.5(.5)5) ///
	xtitle(MM(Confidence) by `b') ///
	subtitle(, justification(left) bcolor(white)) name(rate`a')	

}

graph use "Figure5Legend.gph"

gr combine ///
	choiceR1_a ///
	choiceR2_a ///
	choiceR3_a ///
	choiceR5_a ///
	choiceR4_a ///
	Figure5Legend ///
	, col(2) altshrink iscale(1) ysize(8) imargin(0 0 0 5)
graph export Figures/FigureC1.pdf, replace //reformatted manually

gr combine ///
	rateR1_a ///
	rateR2_a ///
	rateR3_a ///
	rateR5_a ///
	rateR4_a ///
	Figure5Legend ///
	, col(2) altshrink iscale(1) ysize(8) imargin(0 0 0 5)
graph export Figures/Figure5.pdf, replace //reformatted manually



********************************************************************************
** ROBUSTNESS CHECKS: weighted data / Appendix Figure D10
********************************************************************************


** Choice

clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


reg Con_ch i.Con_a##i.R1_a if Scenario=="Energy" [pw=W] , cl(id) noomitted
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_ch i.Con_a##i.R1_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_ch i.Con_a##i.R2_a if Scenario=="Energy" [pw=W] , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_ch i.Con_a##i.R2_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_ch i.Con_a##i.R3_a if Scenario=="Energy" [pw=W] , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_ch i.Con_a##i.R3_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_ch i.Con_a##i.R4_a if Scenario=="Energy" [pw=W] , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_ch i.Con_a##i.R4_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_ch i.Con_a##i.R5_a if Scenario=="Energy" [pw=W] , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_ch i.Con_a##i.R5_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	

gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.8) title("Conditional AMCE on choice") imargin(0 0 0 0) 
graph export Figures/FigureD10a.pdf, replace 



** rate


clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


reg Con_rate i.Con_a##i.R1_a if Scenario=="Energy" [pw=W] , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_rate i.Con_a##i.R1_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_rate i.Con_a##i.R2_a if Scenario=="Energy" [pw=W] , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_rate i.Con_a##i.R2_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_rate i.Con_a##i.R3_a if Scenario=="Energy" [pw=W] , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_rate i.Con_a##i.R3_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_rate i.Con_a##i.R4_a if Scenario=="Energy" [pw=W] , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_rate i.Con_a##i.R4_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_rate i.Con_a##i.R5_a if Scenario=="Energy" [pw=W] , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_rate i.Con_a##i.R5_a if Scenario=="Internet" [pw=W] , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	

gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.8) title("Conditional AMCE on confidence") imargin(0 0 0 0) 
graph export Figures/FigureD10b.pdf, replace 



********************************************************************************
* ROBUSTENESS CHECK: by order of experim. treatment / Appendix Figures D11/D12
********************************************************************************

** Choice

foreach c in blockorder profile {


clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


gen blockorder=0 // order of blocks (3 blocks overall)
replace blockorder=BlockOrderr2 if nScenario==1
replace blockorder=BlockOrderr3 if nScenario==2
tab blockorder

destring Profile, generate(profile) // order of profiles
tab profile

reg Con_ch i.Con_a##i.R1_a##i.`c' nScenario , cl(id)
estimates store R1

margins, dydx(Con_a) at(R1_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")
	

reg Con_ch i.Con_a##i.R2_a##i.`c' nScenario , cl(id)
estimates store R2

margins, dydx(Con_a) at(R2_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///	
	legend(off) ///
	name(R2) xtitle("Public Interest")
	
	
reg Con_ch i.Con_a##i.R3_a##i.`c' nScenario , cl(id)
estimates store R3

margins, dydx(Con_a) at(R3_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	

reg Con_ch i.Con_a##i.R4_a##i.`c' nScenario , cl(id)
estimates store R4

margins, dydx(Con_a) at(R4_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")	

	
reg Con_ch i.Con_a##i.R5_a##i.`c' nScenario , cl(id)
estimates store R5

margins, dydx(Con_a) at(R5_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	
	

gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on choice") imargin(0 0 0 0) 
graph export Figures/FigureD11andD12_a_`c'.pdf, replace
} 


** rate

foreach c in blockorder profile {

clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


gen blockorder=0 // order of blocks (3 blocks overall)
replace blockorder=BlockOrderr2 if nScenario==1
replace blockorder=BlockOrderr3 if nScenario==2
tab blockorder

destring Profile, generate(profile) // order of profiles
tab profile

reg Con_rate i.Con_a##i.R1_a##i.`c' nScenario , cl(id)
estimates store R1

margins, dydx(Con_a) at(R1_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")
	

reg Con_rate i.Con_a##i.R2_a##i.`c' nScenario , cl(id)
estimates store R2

margins, dydx(Con_a) at(R2_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///	
	legend(off) ///
	name(R2) xtitle("Public Interest")
	
	
reg Con_rate i.Con_a##i.R3_a##i.`c' nScenario , cl(id)
estimates store R3

margins, dydx(Con_a) at(R3_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	

reg Con_rate i.Con_a##i.R4_a##i.`c' nScenario , cl(id)
estimates store R4

margins, dydx(Con_a) at(R4_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")	

	
reg Con_rate i.Con_a##i.R5_a##i.`c' nScenario , cl(id)
estimates store R5

margins, dydx(Con_a) at(R5_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	


gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on confidence") imargin(0 0 0 0) 
graph export Figures/FigureD11andD12_b_`c'.pdf, replace

} 



********************************************************************************
** ROBUSTNESS CHECK: other components of design / Appendix Figures D13-D15
********************************************************************************



** Choice

foreach c in Vig_F1 Vig_F2 Vig_F3 {

clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


reg Con_ch i.Con_a##i.R1_a##i.`c' nScenario , cl(id)
estimates store R1

margins, dydx(Con_a) at(R1_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")
	

reg Con_ch i.Con_a##i.R2_a##i.`c' nScenario , cl(id)
estimates store R2

margins, dydx(Con_a) at(R2_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///	
	legend(off) ///
	name(R2) xtitle("Public Interest")
	
	
reg Con_ch i.Con_a##i.R3_a##i.`c' nScenario , cl(id)
estimates store R3

margins, dydx(Con_a) at(R3_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	

reg Con_ch i.Con_a##i.R4_a##i.`c' nScenario , cl(id)
estimates store R4

margins, dydx(Con_a) at(R4_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")	

	
reg Con_ch i.Con_a##i.R5_a##i.`c' nScenario , cl(id)
estimates store R5

margins, dydx(Con_a) at(R5_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.1(.1).4) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	

gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on choice") imargin(0 0 0 0) 
graph export Figures/FiguresD13toD15_a_`c'.pdf, replace
} 


** rate

foreach c in Vig_F1 Vig_F2 Vig_F3 {

clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


reg Con_rate i.Con_a##i.R1_a##i.`c' nScenario , cl(id)
estimates store R1

margins, dydx(Con_a) at(R1_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")
	

reg Con_rate i.Con_a##i.R2_a##i.`c' nScenario , cl(id)
estimates store R2

margins, dydx(Con_a) at(R2_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///	
	legend(off) ///
	name(R2) xtitle("Public Interest")
	
	
reg Con_rate i.Con_a##i.R3_a##i.`c' nScenario , cl(id)
estimates store R3

margins, dydx(Con_a) at(R3_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	

reg Con_rate i.Con_a##i.R4_a##i.`c' nScenario , cl(id)
estimates store R4

margins, dydx(Con_a) at(R4_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")	

	
reg Con_rate i.Con_a##i.R5_a##i.`c' nScenario , cl(id)
estimates store R5

margins, dydx(Con_a) at(R5_a=(1(1)6)) over(`c')
marginsplot, recast(scatter) ///
	ytitle("") ylabel(-.3(.1)1.2) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	
	
gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on confidence") imargin(0 0 0 0) 
graph export Figures/FiguresD13toD15_b_`c'.pdf, replace

} 



********************************************************************************
* ROBUSTENESS CHECK: by country / Appendix Figures D16-D19
********************************************************************************


foreach c in BR DE US ZA { 
 
 
** Choice

clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


keep if `c'==1

reg Con_ch i.Con_a##i.R1_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_ch i.Con_a##i.R1_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_ch i.Con_a##i.R2_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_ch i.Con_a##i.R2_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_ch i.Con_a##i.R3_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_ch i.Con_a##i.R3_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_ch i.Con_a##i.R4_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_ch i.Con_a##i.R4_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_ch i.Con_a##i.R5_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_ch i.Con_a##i.R5_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	
	
gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on choice - `c'")  ///
	 imargin(0 0 0 0) 
graph export Figures/FigureD16toD19_a_`c'.pdf, replace
} 

** rate

foreach c in BR DE US ZA {
	
clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


keep if `c'==1


reg Con_rate i.Con_a##i.R1_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_rate i.Con_a##i.R1_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_rate i.Con_a##i.R2_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_rate i.Con_a##i.R2_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_rate i.Con_a##i.R3_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_rate i.Con_a##i.R3_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_rate i.Con_a##i.R4_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_rate i.Con_a##i.R4_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_rate i.Con_a##i.R5_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_rate i.Con_a##i.R5_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	
	

gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on confidence - `c'")  ///
	imargin(0 0 0 0) 
graph export Figures/FigureD16toD19_b_`c'.pdf, replace
	
} 


********************************************************************************
* ROBUSTENESS CHECK: by actor / Appendix Figures D20-D23
********************************************************************************


foreach c in Companies Scientists CSOs Citizens {


** Choice

clear
use replication3  // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain
decode Actor, generate(sActor)
keep if sActor=="`c'"


reg Con_ch i.Con_a##i.R1_a if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_ch i.Con_a##i.R1_a if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_ch i.Con_a##i.R2_a  if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_ch i.Con_a##i.R2_a  if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_ch i.Con_a##i.R3_a  if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_ch i.Con_a##i.R3_a  if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_ch i.Con_a##i.R4_a  if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_ch i.Con_a##i.R4_a  if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_ch i.Con_a##i.R5_a  if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_ch i.Con_a##i.R5_a  if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.1(.1).4) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	

	
gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on choice - `c'") imargin(0 0 0 0) 
graph export Figures/FiguresD20toD23_choice_`c'.pdf, replace
} 

** rate


foreach c in Companies Scientists CSOs Citizens {

clear
use replication3  // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain
decode Actor, generate(sActor)
keep if sActor=="`c'"


reg Con_rate i.Con_a##i.R1_a  if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_rate i.Con_a##i.R1_a  if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_rate i.Con_a##i.R2_a  if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_rate i.Con_a##i.R2_a  if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_rate i.Con_a##i.R3_a  if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_rate i.Con_a##i.R3_a  if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_rate i.Con_a##i.R4_a  if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_rate i.Con_a##i.R4_a  if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_rate i.Con_a##i.R5_a  if Scenario=="Energy"  , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_rate i.Con_a##i.R5_a  if Scenario=="Internet"  , cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel( -.3(.1)1.2) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	
	

gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on confidence - `c'")  ///
	imargin(0 0 0 0) 
graph export Figures/FiguresD20toD23_confidence_`c'.pdf, replace
	
} 


********************************************************************************
* ROBUSTNESS CHECK: controls / Appendix Table D1 & Figure D24
********************************************************************************

clear
use replication1  // UoA is scenario-profile-actor (N = 48)

asdoc tabstat ///
globorg globrules E1_inter-E2_globg leftright govconf  ///
	polsysatis incsatis educ age male ///
, stat(min mean max sd N) col(stat) format(%9.3f), col nof  ///
	save(Tables/TableD1.rtf) replace 


** Choice

clear

use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain
vl create CONTROLS = (globorg globrules leftright govconf polsysatis  ///
	incsatis E1_inter-E2_globg educ age male)
													 

reg Con_ch i.Con_a##i.R1_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_ch i.Con_a##i.R1_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_ch i.Con_a##i.R2_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_ch i.Con_a##i.R2_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_ch i.Con_a##i.R3_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_ch i.Con_a##i.R3_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_ch i.Con_a##i.R4_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_ch i.Con_a##i.R4_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_ch i.Con_a##i.R5_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_ch i.Con_a##i.R5_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.05(.05).30) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	
	
	
gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on choice") imargin(0 0 0 0) 
graph export Figures/FigureD24a.pdf, replace


** rate


clear
use replication3  // UoA is scenario-profile-actor (N = 48)
drop if Actor==0

estimates drop _all
graph drop _all
set scheme plotplain


reg Con_rate i.Con_a##i.R1_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(E_R1, replace)
estimates store E_R1

reg Con_rate i.Con_a##i.R1_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R1_a=(1(1)6)) saving(I_R1, replace)
estimates store I_R1

combomarginsplot E_R1 I_R1, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R1) xtitle("Expertise")


reg Con_rate i.Con_a##i.R2_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(E_R2, replace)
estimates store E_R2

reg Con_rate i.Con_a##i.R2_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R2_a=(1(1)6)) saving(I_R2, replace)
estimates store I_R2

combomarginsplot E_R2 I_R2, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R2) xtitle("Public Interest")
	

reg Con_rate i.Con_a##i.R3_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(E_R3, replace)
estimates store E_R3

reg Con_rate i.Con_a##i.R3_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R3_a=(1(1)6)) saving(I_R3, replace)
estimates store I_R3

combomarginsplot E_R3 I_R3, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R3) xtitle("Representation")	
	
	
reg Con_rate i.Con_a##i.R4_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(E_R4, replace)
estimates store E_R4

reg Con_rate i.Con_a##i.R4_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R4_a=(1(1)6)) saving(I_R4, replace)
estimates store I_R4

combomarginsplot E_R4 I_R4, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(pos(11) ring(0) r(3)region(lstyle(none))) ///
	name(R4) xtitle("Operational")		
	

reg Con_rate i.Con_a##i.R5_a i.Actor $CONTROLS if Scenario=="Energy", cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(E_R5, replace)
estimates store E_R5

reg Con_rate i.Con_a##i.R5_a i.Actor $CONTROLS if Scenario=="Internet", cl(id)
margins, dydx(Con_a) at(R5_a=(1(1)6)) saving(I_R5, replace)
estimates store I_R5

combomarginsplot E_R5 I_R5, labels("Energy" "Internet") ///
	recast(scatter) ///
	ytitle("") ylabel(-.1(.1).8) title("") ///
	legend(off) ///
	name(R5) xtitle("Transparency")	
	
	
gr combine ///
	R1 ///
	R2 ///	
	R3 ///
	R5 ///		
	R4 ///
	, col(5) iscale(.75) title("Conditional AMCE on confidence") imargin(0 0 0 0) 
graph export Figures/FigureD24b.pdf, replace



********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
** Hypo3 *** Governance contributions: Actor-specific expectations *************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************

********************************************************************************
* Contribution Variables Descriptives / Appendix Figure C2 and Table C5
********************************************************************************

clear
use replication3  // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain											 

twoway (hist R1_a, percent lcolor(gs12) fcolor(gs12) xlabel(1(1)6) disc), /// 
	by(Actor, col(4) note(""))  legend(off) name(R1)
twoway (hist R2_a, percent lcolor(gs12) fcolor(gs12) xlabel(1(1)6) disc), /// 
	by(Actor, col(4) note(""))  legend(off) name(R2)
twoway (hist R3_a, percent lcolor(gs12) fcolor(gs12) xlabel(1(1)6) disc), /// 
	by(Actor, col(4) note(""))  legend(off) name(R3)
twoway (hist R4_a, percent lcolor(gs12) fcolor(gs12) xlabel(1(1)6) disc), /// 
	by(Actor, col(4) note(""))  legend(off) name(R4)
twoway (hist R5_a, percent lcolor(gs12) fcolor(gs12) xlabel(1(1)6) disc), /// 
	by(Actor, col(4) note(""))  legend(off) name(R5)

gr combine R1 R2 R3 R5 R4 ///
	, col(1) iscale(.6)  ysize(7) xsize(5)
	
graph export Figures/FigureC2.pdf, replace

**

clear

use replication1
format  Q11r1-Q15r5   %9.3fc
asdoc sum ///
	Q11r1-Q11r3 Q11r5 Q11r4 ///
	Q12r1-Q12r3 Q12r5 Q12r4 ///
	Q13r1-Q13r3 Q13r5 Q13r4 ///
	Q14r1-Q14r3 Q14r5 Q14r4 ///
	Q15r1-Q15r3 Q15r5 Q15r4 ///
	, separator(0) f statistics(N min max mean sd)  ///
	save(Tables/TableC5.rtf) replace 


********************************************************************************
* MAIN ANALYSIS: Contributions by Actor / Figure 6 and Appendix Tables C6 and C7
********************************************************************************

clear
use replication3  // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain

gen Rall = (R1_a +R2_a +R3_a +R4_a +R5_a)/5

graph dot (mean) R1_a R2_a R3_a R5_a R4_a Rall, over(Actor) ///
	ylabel(3(.5)5) exclude0 ///
	legend(order(1 "Expertise" 2 "Public Interest" 3 "Representation" ///
	4 "Transparency" 5 "Operational" 6 "Average contribution") cols(1))
graph export Figures/Figure6.pdf, replace


*** t-tests with Bonferroni Adjustment
* following a suggestion by Joseph Convey 
* (at https://www.statalist.org/forums/forum/general-stata-discussion/ 
* general/1760139-bonferroni-correction-to-ttest)


clear
use replication1 // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain

generate byte k = 1

manova Q11r1 Q11r2 Q11r3 Q11r5 Q11r4  = k , noconstant
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), ///
	save(Tables/TableC6.rtf) replace

forvalues i= 12/15 {
manova Q`i'r1 Q`i'r2 Q`i'r3 Q`i'r5 Q`i'r4 = k , noconstant  
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), rowappend
} 


manova Q11r1 Q12r1 Q13r1 Q14r1 Q15r1 = k , noconstant
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), ///
	save(Tables/TableC7.rtf) replace


foreach i of numlist 2 3 5 4 {
manova Q11r`i' Q12r`i' Q13r`i' Q14r`i' Q15r`i' = k , noconstant  
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), rowappend
} 


********************************************************************************
* ROBUSTNESS CHECK: weights / Appendix Figure D25
********************************************************************************

clear
use replication3  // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain

gen Rall = (R1_a +R2_a +R3_a +R4_a +R5_a)/5

graph dot (mean) R1_a R2_a R3_a R5_a R4_a Rall [pw=W], ///
	over(Actor) ylabel(3(.5)5) exclude0 ///
legend(order(1 "Expertise" 2 "Public Interest" 3 "Representation" ///
	4 "Transparency" 5 "Operational" 6 "Average contribution") cols(1))
graph export Figures/FigureD25.pdf, replace


*** t-tests (bonferroni corrected)

clear

use replication1 // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain

generate byte k = 1

manova Q11r1 Q11r2 Q11r3 Q11r4 Q11r5 = k [aw=W], noconstant
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), ///
	save(Tables/FigureD25ttests1.rtf) replace

forvalues i= 12/15 {
manova Q`i'r1 Q`i'r2 Q`i'r3 Q`i'r4 Q`i'r5 = k [aw=W], noconstant  
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), rowappend
} 


manova Q11r1 Q12r1 Q13r1 Q14r1 Q15r1 = k [aw=W], noconstant
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), ///
	save(Tables/FigureD25ttests2.rtf) replace


forvalues i= 2/5 {
manova Q11r`i' Q12r`i' Q13r`i' Q14r`i' Q15r`i' = k [aw=W], noconstant  
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), rowappend
} 


********************************************************************************
* ROBUSTNESS CHECK: by country / Appendix Figure D26
********************************************************************************

clear
use replication3  // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain

gen Rall = (R1_a +R2_a +R3_a +R4_a +R5_a)/5

graph dot (mean) R1_a R2_a R3_a R5_a R4_a Rall, ///
	over(Actor) by(dCountry, note("")) ylabel(2.5(.5)5) exclude0 ///
legend(order(1 "Expertise" 2 "Public Interest" 3 "Representation" ///
	4 "Transparency" 5 "Operational" 6 "Average contribution") cols(3))
graph export Figures/FigureD26.pdf, replace


** t-tests

foreach x in BR DE US ZA {
clear

use replication1 // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain
keep if `x'==1

generate byte k = 1

manova Q11r1 Q11r2 Q11r3 Q11r4 Q11r5 = k, noconstant
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), ///
	save(Tables/FigureD26ttests1_`x'.rtf) replace

forvalues i= 12/15 {
manova Q`i'r1 Q`i'r2 Q`i'r3 Q`i'r4 Q`i'r5 = k, noconstant  
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), rowappend
} 
} 



foreach x in BR DE US ZA {

clear
use replication1 // UoA is scenario-profile-actor (N = 48)

estimates drop _all
graph drop _all
set scheme plotplain
keep if `x'==1

generate byte k = 1

manova Q11r1 Q12r1 Q13r1 Q14r1 Q15r1 = k, noconstant
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), ///
	save(Tables/FigureD26ttests2_`x'.rtf) replace

forvalues i= 2/5 {
manova Q11r`i' Q12r`i' Q13r`i' Q14r`i' Q15r`i' = k , noconstant  
asdoc margins , pwcompare(pveffects) mcompare(bonferroni), rowappend
} 
} 


********************************************************************************
********************************************************************************
*************************** DONE :) ********************************************
********************************************************************************
********************************************************************************


